package com.gpframework.module.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gpframework.module.common.domain.CommonStoreConfigValue;
import com.gpframework.module.common.domain.vo.CommonStoreConfigValueVo;
import com.gpframework.module.common.mapper.CommonStoreConfigValueMapper;
import com.gpframework.module.common.service.ICommonStoreConfigValueService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName CommonStoreConfigValue
 * @Author gpframework
 * @Date 2022-04-07
 * @Version 1.0.0
 * @Description 店铺基础配置值Service业务层处理
 */
@Service
public class CommonStoreConfigValueServiceImpl extends ServiceImpl<CommonStoreConfigValueMapper, CommonStoreConfigValue> implements ICommonStoreConfigValueService {

    /**
     * @Description 查询列表返回VO 用于返回给前端的列表接口
     * @Author gpframework
     * @Date 2022-04-07
     * @Param [lqw]
     * @Return List<CommonStoreConfigValueVo>
     */
    @Override
    public List<CommonStoreConfigValueVo> listVo(QueryWrapper<CommonStoreConfigValue> lqw) {
        return this.baseMapper.listVo(lqw);
    }

    /**
     * @Description 通过查询详情VO 用于返回给前端的列详情接口
     * @Author gpframework
     * @Date 2022-04-07
     * @Param [id]
     * @Return CommonStoreConfigValueVo
     */
    @Override
    public CommonStoreConfigValueVo getVoById(Long id) {
        return this.baseMapper.getVo(id);
    }

    /**
     * 根据key查询
     *
     * @param key
     * @return
     */
    @Override
    public CommonStoreConfigValueVo findByKey(String key) {
        return this.baseMapper.findByKey(key);
    }

    /**
     * 根据门店id删除配置
     *
     * @param storeId
     * @return
     */
    @Override
    public Integer delByStoreId(Long storeId) {
        return this.baseMapper.delByStoreId(storeId);
    }
}
